package com.example.reference_book.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("BookScoreFactory")
public class BookScoreFactory {

    @Resource
    private BookTotalScoreCalculate calculate;

    @GetMapping("/{type}")
    public BookRefScore getScore(@PathVariable("type") Integer type){
        if (type==1){
            return this.calculate;
        }
        else
            return null;
    }
}
